package com.cc.entity;

import lombok.Data;
import java.util.List;


@Data
public class Page <T>{
    //当前页码
    private int pageNum=1;
    //每页显示的条数
    private int pageSize=5;
    //总条数
    private int total;
    //总页数
    private int totalPage;
    //数据
    private List<T> data;

    public void setTotal(int total) {
        if (total > 0){
            this.totalPage = (total%pageSize==0)?(total/pageSize):(total/pageSize+1);
        }
        this.total = total;
    }
}
